import http from '@/utils/http.js'
import store from '../store/index.js'
export const userReg = (user)=>{
	return http.post('/users',user)
}

export const userLogin = (user)=>{
	return http.post('/login',user)
}

export const userUpdate = (obj)=>{ //更新用户信息
	// console.log(store);
	let {objectId,sessionToken} = store.state.user.userInfo
	http.config.header['X-LC-Session'] = sessionToken
	return http.put(`/users/${objectId}`,obj)
}